import java.util.Scanner;

public class Javaclass {


    //华氏度的转换
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);            //标准输入
        double t = in.nextDouble();                     //进入程序

        double tem = (t - 32) * (5.0 / 9);              //运算
        System.out.println("摄氏度为: " + tem);

        in.close();
    }


    //输入一个数,逆序输出数字
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();

        while (t != 0) {
            System.out.print(t % 10 + " ");
            t /= 10;
        }

        in.close();
    }


    //输入三位数,求三个数字的和
    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();

        int n = 0;                  //初始化
        int sum = 0;

        while (t != 0) {
            n = t % 10;             //依次取模求出各个数字,123得3
            sum += n;               //数字求和
            t /= 10;                //除10,每次减少一位数,123变12
        }
        System.out.println(sum);

        in.close();
    }


    //输入半径和高求圆柱体积
    public static void main4(String[] args) {
        System.out.printf("%.2f\n", volume(2, 6));  //结果保留两位小数 用printf和"%.2f\n",
    }

    public static double volume(double x, double y) {
        return x * x * Math.PI * y;                      //圆柱体积公式
    }


    //美元兑换率换算
    public static void main5(String[] args) {
        Scanner in = new Scanner(System.in);    //标准输入
        double mon = in.nextDouble();

        double rate = 0;                        //初始化rate
        rate = mon * 6.89;                      //运算并接收最后值

        System.out.printf("%.2f\n", rate);      //保留两位小数

        in.close();
    }


    //计算BIM值(健康指数)
    public static void main6(String[] args) {

        Scanner in = new Scanner(System.in);

        System.out.println("请输入您的体重kg");
        double weight = in.nextDouble();

        System.out.println("请输入您的身高m");
        double high = in.nextDouble();

        double n = bim(weight, high);

        System.out.printf("您的BIM值约为: %.2f\n", n);  //记住是,连接 不是用+号!!!
        if (n < 18.5) {
            System.out.println("偏瘦!");
        } else if (n >= 28) {
            System.out.println("超重!");
        } else {
            System.out.println("正常!");
        }
    }

    public static double bim(double w, double h) {
        double BIM = 0;
        BIM = w / (h * h);
        return BIM;
    }


    //输入小数打印整数部分和小数部分
    public static void main7(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("请输入一个浮点数: ");
        out(in.nextDouble());
        in.close();
    }

    public static void out(double x) {

        int n = (int)x;                       //强转类型
        double m = x - n;                     //减去整数部分
        System.out.println("整数部分: " + n);
        System.out.println("小数部分: " + m);
    }


    //计算求根公式
    public static void main8(String[] args) {
        Scanner in = new Scanner(System.in);

        double a = in.nextDouble();
        double b = in.nextDouble();
        double c = in.nextDouble();

        double x = sum(a, b, c);

        in.close();
    }

    public static double sum(double a, double b, double c) {
        double n = (b * b) - (4 * a * c);
        if (n >= 0 && a != 0) {
            double n1 = Math.sqrt(n);
            double B = -b;
            double sum1 = (B + n) / (2 * a);
            System.out.println("计算结果为: " + sum1);
        } else {
            System.out.println("您输入的数字无法求出!!!");
        }
        return 0;
    }


    //计算年利率
    public static void main9(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.print("请输入贷款的年利率（例如：7.5 表示7.5%）：");
        double x = scanner.nextDouble();

        System.out.print("请输入贷款总额：");
        double y = scanner.nextDouble();

        System.out.print("请输入贷款年数：");
        int z = scanner.nextInt();

        rate(x, y, z);
        scanner.close();
    }


    public static void rate(double x, double y, int z) {

        double A = x / 1200;    //月利率

        int n = z * 12;

        double Payment = (A * y) / (1 - (1 / Math.pow(1 + A, n)));

        double total = Payment * n;

        System.out.printf("月支付额：%.2f%n", Payment);
        System.out.printf("总偿还金额：%.2f%n", total);


    }

}